﻿@using WSS.Pub
@{
    ViewBag.Title = "Home";
    
}


@section css
{
    <style>
        .green
        {
            color: green;
        }
    </style>

}

@section script{
    <script>
        $(function () {

            $("#testbtn").click(function () {
                mainfn.window("http://baidu.com", { modal: false });
            });
        });
    </script>
}

<div style="position: fixed; top: 5px; right: 5px; padding: 5px;">
    <ul class="nav nav-pills nav-stacked">
        <li class="active"><a href="#A001">ORACLE配置示例</a></li>
        <li><a href="#A002">Javascript</a></li>
        <li><a href="#A003">.Net</a></li>
    </ul>
</div>

<div class="container">

    <div class="well">
        <p>
            <a href="http://v3.bootcss.com/getting-started/">Bootstrap 中文官网</a>
        </p>
        <p>
            <a href="http://www.bootcss.com/p/font-awesome/">系统支持的图标 font-awesome IE7+(Bootstrap2.x)</a>
        </p>
        <p>
            <a href="http://fortawesome.github.io/Font-Awesome/icons/">系统支持的图标 font-awesome IE7+(Bootstrap3.x)</a>
        </p>
        <p>
            <a href="http://www.bootcss.com/p/chart.js/docs/">系统分析图表彩用 chart.js(html5)插件,IE6-8需引用excavas.ie8</a>
        </p>
    </div>

    <div class="well">
        <h2>WSS(Web Study System)API:</h2>
        <p>&nbsp;<a id="A001">&nbsp;</a></p>
        @Html.MyLabel("ORACLE配置示例，蓝色为连接服务器数据库的配置", "primary", "lg")
        <p>&nbsp;</p>
        <pre>
< dataSource name="wss" connectionString="Data Source=server_wss;user=wss;password=wss" / >
            <br />
# listener.ora Network Configuration File: F:\oracle\product\10.2.0\db_2\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = G:\oracle\product\10.2.0\db_1)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = crh-PC)(PORT = 1521))
    )
  )
<span style="font:normal normal 12px/12px Microsoft Yahei; color: blue;">
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.8)(PORT = 1521))
    )
  )

</span>
            
# tnsnames.ora Network Configuration File: F:\oracle\product\10.2.0\db_2\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = crh-PC)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

<span style="font:normal normal 12px/12px Microsoft Yahei; color: blue;">
server_wss=
(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.0.8)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
</span>

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )


        </pre>

        <p>&nbsp;<a id="A002">&nbsp;</a></p>
        @Html.MyLabel("Javascript", "primary", "lg")

        <p>&nbsp;</p>
        <div class="well">
            <small class="green">//基础脚本</small>
            <code>
                <pre>
mainfn.msg("消息内容");<span class="green">//系统右下角弹窗</span>
<br />
mainfn.setReadonly("元素ID");<span class="green">//设置只读,并改变元素背景色</span>
mainfn.removeReadonly("元素ID");<span class="green">//清除只读等</span>
<br />
mainfn.setNotnull("元素ID");<span class="green">//设置不可为空,并改变元素背景色,在调用 [mainfn.checkForm()]时，会提示必填 </span>
mainfn.removeNotnull("元素ID");<span class="green">//清除不可为空等</span>
<br />
mainfn.checkForm("jQuery表单对象");<span class="green">//验证表单notnul项</span>
mainfn.loadForm("jQuery表单对象","表单数据对象");<span class="green">//加载表单数据</span>
</pre>

                <small class="green">&nbsp;&nbsp;//扩展系统对象</small>
                <pre>
"".format("我是{0},今年{1}岁。","李磊",12);<span class="green">//我是李磊,今年12岁。</span>
"/Date(1391*json date *31313)/".fmtjsondate("yyyy-MM-dd");<span class="green">//2014-05-06</span>

(new Date()).format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423  
(new Date()).format("yyyy-MM-dd E HH:mm:ss") ==> 2009-03-10 二 20:09:04  
(new Date()).format("yyyy-MM-dd EE hh:mm:ss") ==> 2009-03-10 周二 08:09:04  
(new Date()).format("yyyy-MM-dd EEE hh:mm:ss") ==> 2009-03-10 星期二 08:09:04  
(new Date()).format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18  
                    </pre>

            </code>

            <small class="green">//模态对话框（dialog）</small>
            <code>
                <pre>
<span class="green">//当 回调方法反回 true 时，单击迎按钮会关闭该对话框;反之不关闭</span>
mainfn.dialog("标题", "内容（可以为html、jquery对象）", 回调方法, "按钮名称");
                </pre>
            </code>

            <small class="green">//弹窗（window）</small>
            <code>
                <pre>
mainfn.window(url, {width: 550,height: 400,modal:true,title: "新窗体",level: mainfn.level.lvl_primary});
mainfn.window("close"); 
@Html.MyButton("testbtn", "弹窗测试", "danger", "xs")
                </pre>
            </code>

            <small class="green">//列表（grid）</small>
            <code>
                <pre>
$("#maingrid").bootgrid({ <span class="green">//maingrid 为 table 标签id值</span>
    url: '/usercenter/list/10001',
    pager: "page1",<span class="green">//是否带分页，使用 ul 标签（id 值）</span>
    headers: ["ID", "HOSP_ID", "工号", "姓名", "性别", "手机", "QQ", "邮箱", "帐号状态"],
    multiple:true,
    <span class="green" >//pagesize:20, 默认为30</span>
    cols: [
        { id: 'USER_ID', hidden: true },
        { id: 'HOSP_ID', hidden: true },
        { id: 'USER_NO' },
        { id: 'USER_NAME' },
        { id: 'USER_GENDER', formatter: { type: "select", fmt: { "1": "男", "2": "女" } } },
        { id: 'USER_PHONE' },
        { id: 'USER_QQ' },
        { id: 'USER_EMAIL' },
        { id: 'FLAG_LOGIN', formatter: { type: "select", fmt: { "1": "启用", "0": "<span style='color:red;'>禁用</span>" } } }
    ],
    ondbclick: function (e, id, row) {
        bindForm(row);<span class="green">//双击行：e: event,id:此处为USER_ID,row : {USERID:"dba",HOSP_ID:"10000",……}</span>
    }
    onclick: function (e, id, row) {
         alert(id);
    },
    onloaded: function () {
        alert('load complete');
    },
    oncheckall: function (checked) {
        alert(checked);<span class="green">//true false   需要设置 multiple : true</span>
    }
});
<span class="green">//查询</span>
$("#maingrid").bootgrid("setGridParam", { username: $("#sch_username").val() });
$("#maingrid").bootgrid("reloadGrid", { page: 1 });
                    
<span class="green">//得到选中行数据</span>
var row = $("#maingrid").bootgrid("getGridSelRow");
if (row) {
    bindForm(row);
}
                </pre>
            </code>
        </div>

        <p>&nbsp;<a id="A003">&nbsp;</a></p>
        @Html.MyLabel(".Net", "primary", "lg")
        <p>&nbsp;</p>
        <div class="well">
            <p class="green">...</p>
        </div>
    </div>
</div>
